<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.qijia.travel.app.*"  %>
<%@ page import="com.qijia.travel.helper.*"  %>
<%@ page import="com.qijia.travel.domain.*"  %>
<%@page import="com.qijia.travel.common.Constants"%>
<%
Guide guide = (Guide)session.getAttribute(Constants.USER_KEY);
if(guide.getGuideType()==null||guide.getGuideType()!=1)
out.println("<script>alert('你没有此权限，请联系管理员开通此权限!');window.close();window.parent.location.reload();</script>");

String dir = session.getServletContext().getRealPath("/");
FileUploadHelper helper = new FileUploadHelper();
		helper.setRequest(request);
		try {
			helper.work();
			List<String> fileNames = helper.getSavedFileName();
			if (fileNames != null && fileNames.size() > 0) {
				String fileName = fileNames.get(0);
				TouristManager manager = new TouristManager();
				manager.inportTourist(dir+Constants.FILE_SAVE_DIR+fileName, session);
			}
			out.println("<script>alert('上传文件成功!');window.close();window.parent.location.reload();</script>");
		} catch (Exception e) {
		    e.printStackTrace();
			out.println("<script>alert('上传文件处理失败!');window.close();window.parent.location.reload();</script>");
		}
%>
